From e28d94bc8baed22da1885488f82cab3160d3afd0 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 29 Nov 2016 11:46:32 +0100 Subject: [PATCH] listbox: Move the priv->gadget allocation It used to be relative to the window, now it is relative to the widget. That is necessary so the snapshot fuction doesn't confuse coordinate systems. --- gtk/gtklistbox.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c index db3a9a5b39..db6e9f00e1 100644 --- a/gtk/gtklistbox.c +++ b/gtk/gtklistbox.c @@ -2735,7 +2735,6 @@ gtk_list_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GtkListBoxPrivate *priv = BOX_PRIV (widget); - GtkAllocation child_allocation; GtkAllocation clip; gtk_widget_set_allocation (widget, allocation); @@ -2745,18 +2744,11 @@ gtk_list_box_size_allocate (GtkWidget *widget, allocation->x, allocation->y, allocation->width, allocation->height); - child_allocation.x = 0; - child_allocation.y = 0; - child_allocation.width = allocation->width; - child_allocation.height = allocation->height; - gtk_css_gadget_allocate (BOX_PRIV (widget)->gadget, - &child_allocation, + allocation, gtk_widget_get_allocated_baseline (widget), &clip); - clip.x += allocation->x; - clip.y += allocation->y; gtk_widget_set_clip (widget, &clip); } @@ -2772,17 +2764,20 @@ gtk_list_box_allocate (GtkCssGadget *gadget, GtkListBoxPrivate *priv = BOX_PRIV (widget); GtkAllocation child_allocation; GtkAllocation header_allocation; + GtkAllocation widget_allocation; GtkListBoxRow *row; GSequenceIter *iter; int child_min; - child_allocation.x = allocation->x; - child_allocation.y = allocation->y; + gtk_widget_get_allocation (widget, &widget_allocation); + + child_allocation.x = allocation->x - widget_allocation.x; + child_allocation.y = allocation->y - widget_allocation.y; child_allocation.width = allocation->width; child_allocation.height = 0; - header_allocation.x = allocation->x; - header_allocation.y = allocation->y; + header_allocation.x = allocation->x - widget_allocation.x; + header_allocation.y = allocation->y - widget_allocation.y; header_allocation.width = allocation->width; header_allocation.height = 0; -- 2.30.2